package org.linlinjava.litemall.db.domain;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;

@Data
@ToString
@EqualsAndHashCode(callSuper = false)
public class LitemallMemberRule {
    /**
     * 主键ID
     */
    private Integer id;

    /**
     * 会员类型，目前只有一种普通会员
     */
    private Integer memberType;

    /**
     * 会员卡名字，如：月卡，季卡，半年卡，年卡
     */
    private String memberName;

    /**
     * 会员时长（天），如30,90，180，360
     */
    private Integer memberDuration;

    /**
     * 会员价格
     */
    private BigDecimal memberAmount;

    /**
     * 是否展示 1展示 0不展示
     */
    private String isShow;

    /**
     * 押金价格
     */
    private BigDecimal deposit;

    /**
     * 可租借次数（一般用不上，备用字段）
     */
    private Integer rentTimes;

    /**
     * 一次可借阅本数
     */
    private Integer availableRentNumber;

    /**
     * 不想还书折扣
     */
    private BigDecimal discount;

    /**
     * 权益图片url
     */
    private String rightsAndInterests;

    /**
     * 分享收益类型，1：按天数，2：按金额
     */
    private Integer rewardType;

    /**
     * 奖励具体数值，天数或金额
     */
    private BigDecimal rewardDetail;

    /**
     * 创建时间
     */
    private LocalDateTime addTime;

    /**
     * 更新时间
     */
    private LocalDateTime updateTime;



    /**
     * This enum was generated by MyBatis Generator.
     * This enum corresponds to the database table litemall_member_rule
     *
     * @mbg.generated
     */
    public enum Column {
        id("id", "id", "INTEGER", false),
        memberType("member_type", "memberType", "INTEGER", false),
        memberName("member_name", "memberName", "VARCHAR", false),
        memberDuration("member_duration", "memberDuration", "INTEGER", false),
        memberAmount("member_amount", "memberAmount", "DECIMAL", false),
        deposit("deposit", "deposit", "DECIMAL", false),
        rentTimes("rent_times", "rentTimes", "INTEGER", false),
        availableRentNumber("available_rent_number", "availableRentNumber", "INTEGER", false),
        discount("discount", "discount", "DECIMAL", false),
        rightsAndInterests("rights_and_interests", "rightsAndInterests", "VARCHAR", false),
        rewardType("reward_type", "rewardType", "INTEGER", false),
        rewardDetail("reward_detail", "rewardDetail", "DECIMAL", false),
        addTime("add_time", "addTime", "TIMESTAMP", false),
        updateTime("update_time", "updateTime", "TIMESTAMP", false);

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_member_rule
         *
         * @mbg.generated
         */
        private static final String BEGINNING_DELIMITER = "`";

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_member_rule
         *
         * @mbg.generated
         */
        private static final String ENDING_DELIMITER = "`";

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_member_rule
         *
         * @mbg.generated
         */
        private final String column;

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_member_rule
         *
         * @mbg.generated
         */
        private final boolean isColumnNameDelimited;

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_member_rule
         *
         * @mbg.generated
         */
        private final String javaProperty;

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_member_rule
         *
         * @mbg.generated
         */
        private final String jdbcType;

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_member_rule
         *
         * @mbg.generated
         */
        public String value() {
            return this.column;
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_member_rule
         *
         * @mbg.generated
         */
        public String getValue() {
            return this.column;
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_member_rule
         *
         * @mbg.generated
         */
        public String getJavaProperty() {
            return this.javaProperty;
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_member_rule
         *
         * @mbg.generated
         */
        public String getJdbcType() {
            return this.jdbcType;
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_member_rule
         *
         * @mbg.generated
         */
        Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
            this.column = column;
            this.javaProperty = javaProperty;
            this.jdbcType = jdbcType;
            this.isColumnNameDelimited = isColumnNameDelimited;
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_member_rule
         *
         * @mbg.generated
         */
        public String desc() {
            return this.getEscapedColumnName() + " DESC";
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_member_rule
         *
         * @mbg.generated
         */
        public String asc() {
            return this.getEscapedColumnName() + " ASC";
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_member_rule
         *
         * @mbg.generated
         */
        public static Column[] excludes(Column ... excludes) {
            ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
            if (excludes != null && excludes.length > 0) {
                columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
            }
            return columns.toArray(new Column[]{});
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_member_rule
         *
         * @mbg.generated
         */
        public String getEscapedColumnName() {
            if (this.isColumnNameDelimited) {
                return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
            } else {
                return this.column;
            }
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_member_rule
         *
         * @mbg.generated
         */
        public String getAliasedEscapedColumnName() {
            return this.getEscapedColumnName();
        }
    }
}
